﻿@using Personalblog.Model.ViewModels;
@using PersonalblogServices.Articels.Dto
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using Newtonsoft.Json
@using Personalblog.Model.Entitys
@model PostViewModel
@inject IConfiguration Configuration

@{
    ViewData["Title"] = $"{Model.Title}";
}

@section head
{
    @if (Configuration.GetSection("Qiliu").GetValue<string>("StarandOff") == "Star")
    {
        <link href="https://cdn.pljzy.top/public/element-plus.css" rel="stylesheet">
    }
    else
    {
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-plus@2.5.1/dist/index.min.css">
    }
    <link rel="stylesheet" href="~/lib/Blog/BlogPost.css"/>
    <link href="https://cdn.bootcdn.net/ajax/libs/highlight.js/11.7.0/styles/base16/papercolor-light.min.css" rel="stylesheet">
}


@await Html.PartialAsync("Widgets/BackToTop", new BackToTopViewModel { IsShowText = false })


<div class="container">
    <div class="row">
        <div class="col-lg-3">
            <div id="sidebar" class="p-3 sticky-lg-top">
                <div class="d-flex align-items-center pb-3 mb-3 link-dark text-decoration-none border-bottom">
                    <span class="bi me-2">
                        <i class="fa-solid fa-rectangle-list fa-2x"></i>
                    </span>
                    <span class="fs-5 fw-semibold">文章目录</span>
                </div>

                <div id="post-toc-container" style="z-index:0">
                    <nav id="navbar-example3" class="h-100 flex-column align-items-stretch pe-4 border-end">
                    </nav>
                </div>
            </div>
        </div>
        <div class="col-lg-9" id="goTop">
            @await Html.PartialAsync("Widegets/PostHeader", Model)
            <div class="post-content" data-bs-spy="scroll"
                 data-bs-offset="0"
                 data-bs-target="#navbar-example3"
                 class="scrollspy-example-2"
                 tabindex="0">
                @Html.Raw(Model.ContentHtml)
            </div>
            @await Html.PartialAsync("Widegets/PostBottom")
            
            @await Html.PartialAsync("Widegets/Comment", Model)
        </div>
    </div>
</div>
<div id="jsi-flying-fish-container" style="background-color:#fff;"></div>

@section bottom
{
    @* 线条特效 *@
    <canvas id="c_n9" width="1920" height="990" style="position: fixed; top: 0px; left: 0px; z-index: -1; opacity: 0.5;"></canvas>
    <script src="~/lib/Blog/BlogPostTeXiao.js"></script>
    @* 鱼 *@
    <script src="~/lib/Blog/BlogPostFish.js"></script>
    <!-- 看板娘模型 -->
    @* <script src="~/lib/Blog/L2Dwidget.min.js"></script> *@
    @* <script src="~/lib/Blog/L2Dwidget.0.min.js"></script> *@
    @* <script src="~/lib/Blog/BlogPost2d.js"></script> *@

    @if (Configuration.GetSection("Qiliu").GetValue<string>("StarandOff") == "Star")
    {
        <script src="https://cdn.pljzy.top/public/index.full.min.js"></script>
    }
    else
    {
        <script src="https://cdn.jsdelivr.net/npm/element-plus@2.5.1/dist/index.full.min.js"></script>
    }
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/dayjs/1.11.7/dayjs.min.js"></script>
    <script src="~/js/comment.js"></script>

    <script src="~/js/blog.post.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script>
    <!-- 引入 clipboard.js 核心文件 -->
    <script src="//cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js"></script>
    <script>
        const nodes = '@Html.Raw(Model.TocNodesJson)'
    </script>
    <script src="~/lib/Blog/BlogPost.js"></script>
}